package com.hanxiaozhang.autocinfigure;

import com.hanxiaozhang.aspect.LockAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 〈一句话功能简述〉<br>
 * 〈分布式锁切面自动注入配置〉
 *
 * @author hanxinghua
 * @create 2023/7/20
 * @since 1.0.0
 */
@Configuration
@ConditionalOnProperty(prefix = "distributed-lock", value = "enabled-annotation", havingValue = "true")
public class LockAspectAutoConfigure {


    @Bean
    @ConditionalOnMissingBean
    public LockAspect lockAspect(){
        return new LockAspect();
    }

}
